export default function(){
    function aside(){
// 点击回到顶部没完成。  下面写的就是个屁，真的恶心
    }
    $.extend(aside.prototype,{
        init : function(){
            this.side_user     = $(".side-user");
            this.side_login    = $(".side-login");
            this.side_love     = $(".side-love");
            this.tab_tips      = $(".tab-tips");
            this.side_quan     = $(".side-quan");
            this.tab_tips_hs   = $(".tab-tips-hs");
            this.side_complain = $(".side-complain");
            this.complain_hs   = $(".complain-hs");
            this.side_code     = $(".side-code");
            this.code_tip      = $(".code-tip");
            this.backTop       = $(".side-backtop");
            this.backTopHs     = $(".backtop-hs");
            this.loginAnimation();
            this.loveAnimation();
            this.quanAnimation();
            this.complain();
            this.backToTop();
            this.code();
            $(window).on("scroll",$.proxy(function(){
                var scrollTop = $("body,html").scrollTop();
                this.backTopShow(scrollTop);
            },this));
        },
        loginAnimation : function(){
            $(this.side_user).on("mouseenter",$.proxy(function(){
                this.side_login[0].style.display = "block";
                $(this.side_login).animate({
                    right : 36 ,
                })
            },this));
            // 需要清除上个事件之后再开始下一个。
            $(this.side_user).on("mouseleave",$.proxy(function(){
                this.side_login[0].style.display = "none";
                $(this.side_login).animate({
                    right : 62,
                },0);
            },this));
        },
        loveAnimation : function(){
            $(this.side_love).on("mouseenter",$.proxy(function(){
                this.tab_tips[0].style.display = "block";
                $(this.tab_tips).animate({
                    right : 36 ,
                })
            },this));
            $(this.side_love).on("mouseleave",$.proxy(function(){
                this.tab_tips[0].style.display = "none";
                $(this.tab_tips).animate({
                    right : 62,
                },0);
            },this));
        },
        quanAnimation : function(){
            $(this.side_quan).on("mouseenter",$.proxy(function(){
                this.tab_tips_hs[0].style.display = "block";
                $(this.tab_tips_hs).animate({
                    right : 36 ,
                })
            },this));
            $(this.side_quan).on("mouseleave",$.proxy(function(){
                this.tab_tips_hs[0].style.display = "none";
                $(this.tab_tips_hs).animate({
                    right : 62,
                },0);
            },this));
        },
        complain : function(){
            $(this.side_complain).on("mouseenter",$.proxy(function(){
                this.complain_hs[0].style.display = "block";
                $(this.complain_hs ).animate({
                    right : 36 ,
                })
            },this));
            $(this.side_complain).on("mouseleave",$.proxy(function(){
                this.complain_hs[0].style.display = "none";
                $(this.complain_hs ).animate({
                    right : 62,
                },0);
            },this));
        },
        backToTop : function(){
            $(this.backTop ).on("mouseenter",$.proxy(function(){
                this.backTopHs[0].style.display = "block";
                $(this.backTopHs).animate({
                    right : 36 ,
                })
            },this));
            $(this.backTop ).on("mouseleave",$.proxy(function(){
                this.backTopHs[0].style.display = "none";
                $(this.backTopHs ).animate({
                    right : 62,
                },0);
            },this));
        },
        code : function(){
            $(this.side_code ).on("mouseenter",$.proxy(function(){
                this.code_tip[0].style.display = "block";
                $(this.code_tip).animate({
                    right : 36 ,
                })
            },this));
            $(this.side_code ).on("mouseleave",$.proxy(function(){
                this.code_tip[0].style.display = "none";
                $(this.code_tip).animate({
                    right : 62,
                },0);
            },this));
        },
        backTopShow : function(data){
            var height = $("#toolbar").outerHeight();
            if(data > height){
                this.backTop[0].style.display = "block";
            } 
            if(data <= height){
                this.backTop[0].style.display = "none";
            }
        }
    })
    return new aside();
}